var util = {
    clone:function (obj) {
        if(typeof(obj) != 'object')
            return obj;
        var re = {};
        if(obj.constructor == Array)
            re = [];
        for(var i in obj){
            re[i] = util.clone(obj[i]);
        }
        return re;
    }
};